GEN2 Automation Studio

On this page:

Pass Data Between Gen2 Tasks

Passing Data Between Tasks

In this section you will add another task to your automation and pass variable data to it.

Prepare the Canvas

Let's prepare the Gen 2 workflow canvas by adding another task.

  1. Go back to the Automation Studio tab.

    • If you closed the application tab, simply go to the IAP home screen and click the "Automation Studio" option in the left navigation menu.
    • Select Find an Automation and search for the "EnlightenMe" automation you created previously.
  2. Click on the transition line between the FetchFact and End nodes.

    Figure 1: Insert Node

    AddNode

  3. Select "Insert Node" from the context menu.

  4. Another "New Node" will appear in line between the two existing nodes.

  5. Click the New Node to bring it into focus.

  6. In the Task Menu Sidebar, search for the "WorkflowEngine" Query task.

  7. Click the Query task to replace the New Node.

  8. Click the Save icon (left side of canvas) to save your work.

You should now have four different (yet connected) tasks on your canvas:

  • START
  • FetchFact
  • Query
  • END

Figure 2. Add Query Task

FourTasks

Configure the Query Task

Next, let's configure the variable information.

  1. If not already selected, click the Query task on the canvas to view the details for the task in the right-side menu.

  2. From the Details tab, change the value in the Summary field from Query Data Using 'json-query' Format to IsolateFact. This will help us distinquish this restCall task from others later on.

  3. Change the Description field to read "Just give me the fact".

  4. Click the Variables tab.

  5. For this example, set the Value of the pass_on_null variable using the slider button to "False" (the slider will be in the left position). This tells the automation to "fail" the task in Job Manager if no value is provided.

    Figure 3. Pass_on_null

    pass_on_null

  6. Set the Value of the query variable to value.joke.

    Figure 4. Query Value

    QueryValue

    You're probably asking where did value.joke come from? To see the origin, go back to the Job Manager tab you left open. Refer to the response variable in the OUTGOING tab of the Task History. The response was provided in the form of a JSON object.

    • In the JASONPath syntax of the response, find where value.joke exists as a key-value pair.

    Note: For more information on JSONPath syntax, we recommend reading JSONPath-XPath for JSON. We also recommend the JSONPath Online Evaluator when experimenting with JSONPath data extraction.

  7. Change the obj Reference Task from "static" to FetchFact and accept the default response that displays. This indicates the data you want to search will be provided by the results of the FetchFact task.

    Figure 5. Query Object

    QueryObject

  8. Click the Save icon (left side of canvas) to save your work.

Run the Automation

To test the automation and see if it works:

  1. Click the blue Play icon (►) to the right of the Save icon on the canvas. A modal window will open.
  2. For now, ignore the entries for "Description" and "Groups".
  3. Click the START button in the left corner of the modal. A modal window will display.
  4. Within the modal window, there's a message link that says VIEW JOB. Once you click the link, a new tab opens in your browser. This new tab displays the Job Manager view of the running job you just started.

Viewing the Job

In the newly opened Job Manager tab, take a moment to study the page to see the different types of information that's available in this view. This time, two tasks are displayed:

  • IsolateFact
  • FetchFact

Figure 6. Job Details

EnlightenMe Job Manager

  1. Click the book icon at the end of the IsolateFact task.
  2. The Outgoing tab in the Task History reveals the value of the return_data variable, indicating that you successfully isolated the incoming fact from the data that was returned by the Query task.

Figure 7. Outgoing Task History

12-EnlightenMe

Summary Wrap-Up

Congratulations on completing this segment of the tour! By now, you should know how to:

  • Build an automation.
  • Pass variable data between tasks in an automation.
  • Use the Query task.

In the next section, you will learn how to customize the input values.